package com.project.mapper;

import com.project.bean.SpeakBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
@Mapper
public interface ISpeakMapper {
    @Insert("INSERT INTO t_speak(fk_userId,fk_bookId,s_content,s_date)values(" +
            "#{userBean.id},#{bookBean.id},#{content},#{speakDate})")
    public void add(SpeakBean speakBean);

    /***
     * 按书籍查询评论，同时查询评论用户名
     * @param id  书籍id
     * @return 评论集合
     */
    public List<SpeakBean> findByBook(int id);
}
